
import { defineStore } from 'pinia'

export const useSettingStore = defineStore({
  id: 'setting',
  state: () => {
    return {
        appName:import.meta.env.VITE_APP_NAME,
        isDark: false,// 深色模式
        showSettings: false,//是否显示设置
        sidebarLogo: true,//是否显示logo
        isBreadcrumb: true,//面包屑
        tagsView: true,//是否显示tag

        appLayout:"left",
        tabTheme:"theme1",
        // 主题一
        themeBackground: "#1d1e1f",
        themeColor:"#ffffff",
        themeActive:"#ffd04b",
        headColor:"#ffffff",

        copyrightName:'呼啦鸽管理后台',
        copyrightLink:'http://dev-ubs-admin.flag.vip/Login'
    }
  },
  getters:{

  },
  actions:{
    getIsDark(event:Boolean){
      this.isDark = event;
    },
    getShowSettings(event:Boolean){
      this.showSettings=event;
    },
    getSetting(event:any){
      this.appLayout=event.appLayout;
      this.tabTheme=event.tabTheme;
      this.sidebarLogo=event.sidebarLogo;
      this.tagsView=event.tagsView;
      this.themeBackground=event.themeBackground;
      this.themeColor=event.themeColor;
      this.themeActive=event.themeActive;
      this.headColor=event.headColor;
      this.isBreadcrumb=event.isBreadcrumb;
    },
    getOutInSetting(){
      this.appLayout='left';
      this.tabTheme='theme1';
      this.showSettings= false;
      this.sidebarLogo= true;
      this.tagsView= true;
      this.isBreadcrumb=true;
      this.themeBackground= "#1d1e1f";
      this.themeColor= "#ffffff";
      this.themeActive= "#ffd04b";
      this.headColor="#ffffff";
    },
  },
  persist: {
    storage: localStorage
  }
})